document.getElementsByClassName("choujiang-box")[0].addEventListener("click",function(){
	xuanliwu();
	this.classList.add("choujiang-boxa");
	document.getElementsByClassName("choujiang-jiantou")[0].remove();
	document.getElementsByClassName("choujiang-text")[0].remove();
	document.getElementsByClassName("zhongjiang")[0].classList.add("zhongjianga");
	var tj = setTimeout(function(){
		document.getElementsByClassName("xiayiguan")[0].classList.add("xiayiguana");
	},2000);
	
	document.getElementsByClassName("xiayi1")[0].addEventListener("click",function(){
		window.location = "ziliao.html";
	})
})

//随机抽
function xuanliwu(){
	var zhongjiang = document.getElementsByClassName("zhongjiang")[0];
	var num = Math.random()*120;
	num = Math.floor(num);
	switch(true){
		//特等奖
		case (num<=0.5) :{
			zhongjiang.getElementsByClassName("redC")[0].innerHTML = " 恭喜您获得了特等奖 ！";
			zhongjiang.getElementsByClassName("blueC")[0].innerHTML = "价值rmb 4999元   梦六方床垫";
			zhongjiang.getElementsByClassName("zhongjiang-jiang")[0].children[0].src = "img/choujiang/jiang0.png";
			break;
		}
		//一等奖
		case (num<=2) :{
			zhongjiang.getElementsByClassName("redC")[0].innerHTML = " 恭喜您获得了一等奖 ！";
			zhongjiang.getElementsByClassName("blueC")[0].innerHTML = "价值rmb 2400元   舒适透气薄垫";
			zhongjiang.getElementsByClassName("zhongjiang-jiang")[0].children[0].src = "img/choujiang/jiang1.png";
			break;
		}
		case (num<=5) :{
			zhongjiang.getElementsByClassName("redC")[0].innerHTML = " 恭喜您获得了二等奖 ！";
			zhongjiang.getElementsByClassName("blueC")[0].innerHTML = "价值rmb 1080元   太空船模型";
			zhongjiang.getElementsByClassName("zhongjiang-jiang")[0].children[0].src = "img/choujiang/jiang2.png";
			break;
		}
		case (num<=10) :{
			zhongjiang.getElementsByClassName("redC")[0].innerHTML = " 恭喜您获得了三等奖 ！";
			zhongjiang.getElementsByClassName("blueC")[0].innerHTML = "价值rmb 2400元   舒适透气薄垫";
			zhongjiang.getElementsByClassName("zhongjiang-jiang")[0].children[0].src = "img/choujiang/jiang3.png";
			break;
		}
		case (num<=20) :{
			zhongjiang.getElementsByClassName("redC")[0].innerHTML = " 恭喜您获得了四等奖 ！";
			zhongjiang.getElementsByClassName("blueC")[0].innerHTML = "价值rmb 389元   悠悠午睡枕";
			zhongjiang.getElementsByClassName("zhongjiang-jiang")[0].children[0].src = "img/choujiang/jiang4.png";
			break;
		}
		case (num<=40) :{
			zhongjiang.getElementsByClassName("redC")[0].innerHTML = " 恭喜您获得了五等奖 ！";
			zhongjiang.getElementsByClassName("blueC")[0].innerHTML = "价值rmb 269元   泰迪熊公仔";
			zhongjiang.getElementsByClassName("zhongjiang-jiang")[0].children[0].src = "img/choujiang/jiang5.png";
			break;
		}
		case (num<=80) :{
			zhongjiang.getElementsByClassName("redC")[0].innerHTML = " 恭喜您获得了六等奖 ！";
			zhongjiang.getElementsByClassName("blueC")[0].innerHTML = "天猫官方旗舰店50元无门槛优惠券";
			zhongjiang.getElementsByClassName("zhongjiang-jiang")[0].children[0].src = "img/choujiang/jiang6.png";
			break;
		}
		case (num<=120) :{
			zhongjiang.getElementsByClassName("redC")[0].innerHTML = " 恭喜您获得了七等奖 ！";
			zhongjiang.getElementsByClassName("blueC")[0].innerHTML = "天猫官方旗舰店30元无门槛优惠券";
			zhongjiang.getElementsByClassName("zhongjiang-jiang")[0].children[0].src = "img/choujiang/jiang7.png";
			break;
		}
	}
}

